﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Broadsides2d
{
    public class Player : Ship
    {
        private int playerNum;
        static public Texture2D texture;
        static public Texture2D texture2;

        public Player(float x, float y, ShipType type, int playerNum) : base(x, y, type)
        {
            this.playerNum = playerNum;
            this.setLife(100);
            this.speed = this.baseSpeed = 1.25f;
        }

        public void setPlayerNum(int playerNum)
        {
            this.playerNum = playerNum;
        }
        public int getPlayerNum()
        {
            return this.playerNum;
        }

        public override void Draw(SpriteBatch batch){
            Vector2 v = Game1.recenter(x, y);

            v.X = ((v.X + World.world.worldSizeInPixels) % World.world.worldSizeInPixels);
            v.Y = ((v.Y + World.world.worldSizeInPixels) % World.world.worldSizeInPixels);
            float scale = 1;

            if (playerNum == 1)
            {
                batch.Draw(texture, v, null, Color.White, rotation, new Vector2(texture.Width / 2, texture.Height / 2), scale, SpriteEffects.None, 0.0f);
            }
            else
            {
                batch.Draw(texture2, v, null, Color.White, rotation, new Vector2(texture.Width / 2, texture.Height / 2), scale, SpriteEffects.None, 0.0f);
            }

        }
    }
}
